import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
  mode: 'history',
  routes: [{
      path: '/index',
      meta: {
        title: '登录'
      },
      component: resolve => require(['@/pages/index'], resolve),
    },
    {
      path: '/',
      meta: {
        title: ''
      },
      component: resolve => require(['@/pages/main'], resolve),
      children: [{
          name: 'home',
          path: 'home',
          meta: {
            title: '首页'
          },
          component: resolve => require(['@/pages/home'], resolve)
        },
        {
          name: 'category',
          path: 'category',
          meta: {
            title: '分类'
          },
          component: resolve => require(['@/pages/category'], resolve)
        },
        {
          name: 'cart',
          path: 'cart',
          meta: {
            title: '购物车'
          },
          component: resolve => require(['@/pages/cart'], resolve)
        },
        {
          name: 'vip',
          path: 'vip',
          meta: {
            title: 'vip导购专区'
          },
          component: resolve => require(['@/pages/vip/vip'], resolve)
        },
        {
          name: 'my',
          path: 'my',
          meta: {
            title: '个人中心'
          },
          component: resolve => require(['@/pages/my/index'], resolve)
        }
      ]
    },
    {
      name: 'proDetail',
      path: '/proDetail',
      meta: {
        title: '商品详情'
      },
      component: resolve => require(['@/pages/product/product-detail'], resolve)
    },
    {
      name: 'proList',
      path: '/proList',
      meta: {
        title: '商品列表'
      },
      component: resolve => require(['@/pages/product/product-list'], resolve)
    },
    {
      name: 'orderPay',
      path: '/orderPay',
      meta: {
        title: '订单支付'
      },
      component: resolve => require(['@/pages/order/order-pay'], resolve)
    },
    {
      name: 'payType',
      path: '/payType',
      meta: {
        title: '选择支付方式'
      },
      component: resolve => require(['@/pages/order/pay-type'], resolve)
    },
    {
      name: 'addressAdd',
      path: '/addressAdd',
      meta: {
        title: '新增地址'
      },
      component: resolve => require(['@/pages/address/address-add'], resolve)
    },
    {
      name: 'addressEdit',
      path: '/addressEdit',
      meta: {
        title: '编辑地址'
      },
      component: resolve => require(['@/pages/address/address-edit'], resolve)
    },
    {
      name: 'orderList',
      path: '/orderList/:id',
      meta: {
        title: '订单列表'
      },
      component: resolve => require(['@/pages/order/order-list'], resolve)
    },
    {
      name: 'search',
      path: '/search',
      meta: {
        title: '搜索'
      },
      component: resolve => require(['@/pages/search'], resolve)
    },
    {
      name: 'logistics',
      path: '/logistics',
      meta: {
        title: '物流详情'
      },
      component: resolve => require(['@/pages/logistics'], resolve)
    },
    {
      name: 'login',
      path: '/login',
      meta: {
        title: '登录'
      },
      component: resolve => require(['@/pages/vip/login'], resolve)
    },
    {
      name: 'incomeDetail',
      path: '/incomeDetail',
      meta: {
        title: '累计预估收入'
      },
      component: resolve => require(['@/pages/vip/income-detail'], resolve)
    },
    {
      name: 'applyProcess',
      path: '/applyProcess',
      meta: {
        title: '应聘流程'
      },
      component: resolve => require(['@/pages/vip/apply-process'], resolve)
    },
    {
      name: 'fbProductList',
      path: '/fbProductList',
      meta: {
        title: '返币商品列表'
      },
      component: resolve => require(['@/pages/product/fb-product-list'], resolve)
    },
    {
      name: 'preferentialProductList',
      path: '/preferentialProductList',
      meta: {
        title: '优惠商品'
      },
      component: resolve => require(['@/pages/product/preferential-product-list'], resolve)
    }
  ]
})
